home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Libraries / Aidan's Class Libraries / Source / Headers / CLEventDispatcher.h < prev    next >
Encoding:
Text File  |  1997-07-19  |  752 b   |  32 lines  |  [TEXT/CWIE]

  1. //Copyright (c) 1997 Aidan Cully
  2. //All rights reserved
  3.  
  4. #ifndef __EVENTDISPATCHER_H
  5. #define __EVENTDISPATCHER_H
  6.  
  7. #include "CLTypes.h"
  8. #include "CLDeviceHandler.h"
  9.  
  10. class MEventDispatcher
  11. {
  12. private:
  13.     static MEventDispatcher *sCurDispatcher;
  14.     static void DispatchEvent( const EventRecord & );
  15.     static TDeviceHandler *mhHandlers[16];
  16.     Boolean mhDone;
  17. protected:
  18.     static void SetDeviceHandler( UINT16, TDeviceHandler* );
  19.     virtual BOOLEAN Run();
  20.     virtual BOOLEAN RunSelf()=0;
  21.     virtual BOOLEAN AttemptQuitSelf();
  22.     virtual void QuitSelf();
  23. public:
  24.     MEventDispatcher();
  25.     static MEventDispatcher *GetDispatcher() {return(sCurDispatcher);};
  26.     virtual ~MEventDispatcher();
  27.     virtual void EventLoop();
  28.     virtual BOOLEAN AttemptQuit();
  29.     virtual void Quit();
  30. };
  31.  
  32. #endif